package gui.menus;

import gui.Main.GUI;
import gui.Main.GUICore;
import gui.menuItems.EndSessionMenuItem;
import gui.menuItems.JoinSessionMenuItem;
import gui.menuItems.LeaveSessionMenuItem;
import gui.menuItems.StartSessionMenuItem;
import hypeerweb.HyPeerWebSegmentCreator;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.net.InetAddress;

import javax.swing.JMenu;
import javax.swing.JMenuItem;

import network.GUICoreProxy;
import network.GlobalObjectId;
import network.HyPeerWebSegmentProxy;
import network.LocalObjectId;
import network.ObjectDB;
import network.PortNumber;

/**
 * Represents the Debug Session Menu
 * 
 * @author Matthew Smith
 */
public class DebugSessionMenu extends JMenu {

	/** Root of the GUI */
	private GUI main;

	/** Start menu item */
	private JMenuItem start;

	/** Join menu item */
	private JMenuItem join;

	/** Leave menu item */
	private JMenuItem leave;

	/** End menu item */
	private JMenuItem end;

	/**
	 * Creates a debug session menu
	 * 
	 * @param main
	 */
	public DebugSessionMenu(GUI main) {
		this.main = main;
		init();
	}

	/**
	 * Initializes GUI components
	 */
	public void init() {
		this.setText("Session");

		start = new StartSessionMenuItem(main);
		add(start);
		start.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				startNewSegment();
			}
		});

		join = new JoinSessionMenuItem(main);
		add(join);
		join.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				joinExistingSegment();
			}
		});

		leave = new LeaveSessionMenuItem(main);
		add(leave);
		leave.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				leaveTheSegment();
			}
		});

		end = new EndSessionMenuItem(main);
		add(end);
		end.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				endHyPeerWeb();
			}
		});
	}
	protected void leaveTheSegment() {

	}

	protected void endHyPeerWeb() {
		// TODO Auto-generated method stub

	}

	protected void joinExistingSegment() {
		// TODO Auto-generated method stub

	}

	protected void startNewSegment() {
		// TODO Auto-generated method stub

	}

}
